package com.example.librarysystem.service;

import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class IDGeneratorService {
    public String generateBorrowID() {
        int currentYear = LocalDate.now().getYear();
        String prefix = "B" + currentYear;
        // 实际应用中应查询数据库获取当前最大ID
        return prefix + "0001";
    }
}